/**
 * 
 */
package tests.acceptanceTests;

import static org.junit.Assert.*;

import java.util.HashMap;
import java.util.Map.Entry;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import sourceFiles.CentralComputer;
import sourceFiles.SupervisorStation;

/**
 * @author LASO-TEAM
 * 
 *         This test checks that a supervisor can see the ticket statistics.
 * 
 */
public class AcceptanceTest4 extends AcceptanceTests {

	private HashMap<Integer, Integer> statistics;
	
	/**
	 * @throws java.lang.Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		// this initializes the relevant classes for this test.
		String currentPath = new java.io.File(".").getCanonicalPath();
		currentPath = currentPath + IN_PROJECT_PATH_TO_TESTS;
		masterXMLFilePath = currentPath + "\\input\\TestsMaster4.xml";
		copyXMLFilePath = currentPath + "\\results\\AcceptanceTests4Result.xml";
	}

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		copySourceFile();
		centralComputer = new CentralComputer(copyXMLFilePath);
		supervisorStation = new SupervisorStation(centralComputer);
	}

	@Test
	public void test() {
		try {
			statistics = supervisorStation.getTicketsAmount();
		} catch (Exception e) {
			fail("supposed to succeed.");
		}
		for (Entry<Integer, Integer> ticket : statistics.entrySet()) {
			assertEquals(0, ticket);
		}
	}

}
